<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
     <head>
 
         <title>用户权限</title>
          <style type="text/css">
    		@import "css/table.css";
		</style>
     </head>
 
    <body>
        <p>|<a href="registerAction!findall.action">用户列表</a></p>
        <s:form action="UserRightAction!edit.action" theme="simple">
            <table>
                <tr>
                    <td style="text-align:right">
                        用户
                    </td>
                    <td>
                   
                        <s:select label="选择用户" list="#session.user_list" name="userId" listKey="id" listValue="nameZh" headerValue="%{#userId}" emptyOption="false" />

                    </td>
                </tr>
                </table>
           <table >
                 <s:iterator id="mlist" value="#session.menu_list" status="st">
	                <tr>                  
	                    <th>
	                    <s:set name="alreadyHas" value="1" /><!-- 存在标识,初始化 -->
	                    
	                    <s:iterator id="rtlist" value="rightlist" status="rt_st">
	                   				 
				                     <s:if test='%{#rtlist.menuId==#mlist.id}'> <!-- 如果该用户有该页面的权限，则标识出来 -->
				                     			<!-- zyn_user_right.id -->
				                     			<input type="hidden" name="rightlist[<s:property value="#st.index"/>].id" value="<s:property value="#rtlist.id"/>"> </input> 
						                        <s:property value="menuNameZh"/>              
						                       	<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].menuId" value="<s:property value="#mlist.id"/>" checked> </input>   
						                       
						                       <s:if test='%{#mlist.extattr1=="b"}'> <!-- 该报表是否有复核，核销等权限控制的操作 -->
						                       		<font size=2px>
						                       		&nbsp;&nbsp;&nbsp;[
								                       <s:if test='%{#rtlist.fuHeOp=="0"}'>
								                       	复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].fuHeOp" value="0" checked> </input>
								                       </s:if>						                     
								                       <s:else>
								                       	复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].fuHeOp" value="0" > </input>
								                       </s:else>
						                     
						                       	       <s:if test='%{#rtlist.cancelFuHeOp=="0"}'>
						                       			取消复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelFuHeOp" value="0" checked> </input>   
						                       		   </s:if>						                     
								                       <s:else>
								                       	取消复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelFuHeOp" value="0" > </input>   
								                       </s:else>
								                     
								                     <s:if test='%{#rtlist.heXiaoOp=="0"}'>
								                     	核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoOp" value="0" checked> </input>
								                     	 </s:if>						                     
								                       <s:else>
								                     	核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoOp" value="0"> </input>
								                     	</s:else>
										             <s:if test='%{#rtlist.cancelHeXiaoOp=="0"}'>        	
								                       	取消核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelHeXiaoOp" value="0" checked> </input>
								                       	 </s:if>						                     
								                       <s:else>
								                       	取消核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelHeXiaoOp" value="0"> </input>
								                       	</s:else>
								                      <s:if test='%{#rtlist.heXiaoAbnorOp=="0"}'> 	
								                       	异常核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoAbnorOp" value="0" checked> </input>
								                       	 </s:if>						                     
								                       <s:else>
								                       	异常核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoAbnorOp" value="0"> </input>
								                       	</s:else>
								                       <s:if test='%{#rtlist.qianPiOp=="0"}'>	
								                       	签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].qianPiOp" value="0" checked> </input>
								                       	 </s:if>						                     
								                       <s:else>
								                       	签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].qianPiOp" value="0"> </input>
								                       	</s:else>
								                       <s:if test='%{#rtlist.cancelQianPiOp=="0"}'>	
								                       	取消签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelQianPiOp" value="0" checked> </input> 
						                       			 </s:if>						                     
								                       <s:else>
						                       			取消签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelQianPiOp" value="0"> </input>   
								                     	</s:else>
								                     	]
								                     </font>
						                       </s:if>
						                      
						                       <s:set name="alreadyHas" value="0" />
				                    </s:if>
				                    <s:else>
				                    		<!--  -->
				                    </s:else>
				               </s:iterator>
				               
				          <s:if test="#alreadyHas!=0">    
						           <s:property value="menuNameZh"/>              
								   <input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].menuId" value="<s:property value="#mlist.id"/>"> </input>   
								   <s:if test='%{#mlist.extattr1=="b"}'>
								   		 <font size=2px>
								   		 	&nbsp;&nbsp;&nbsp;[
								               	复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].fuHeOp" value="0"> </input>   
								     			取消复核<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelFuHeOp" value="0"> </input>
								     			核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoOp" value="0"> </input>
						                       	取消核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelHeXiaoOp" value="0"> </input>
						                       	异常核销<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].heXiaoAbnorOp" value="0"> </input>
						                       	签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].qianPiOp" value="0"> </input>
						                       	取消签批<input type="checkbox"  name="rightlist[<s:property value="#st.index"/>].cancelQianPiOp" value="0"> </input>   
								   		     ]
								   		 </font>
								  </s:if>
						  </s:if>
	                   
	                     
	                     </th>
	                </tr>
                </s:iterator>
           </table>                     
         
           <table>     
                <tr>
                    <td style="text-align:right">
                        <s:submit value="保存" />
                    </td>
                    <td style="text-align:left">
                        <s:reset value="取消"/>
                    </td>
                </tr>
            </table>
        </s:form>
        <s:fielderror cssStyle="color:red"/>
    </body>
</html>
